package com.ws.q1.mapper;

import com.ws.q1.bean.GongYingShang;
import com.ws.q1.bean.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GongYingShangMapper {
    @Insert("insert into gyshang(name,dizhi,phone) values(#{name},#{dizhi},#{phone})")
    int add(@Param("name") String name, @Param("dizhi") String dizhi, @Param("phone") String phone);

    @Select("select * from gyshang")
    List<GongYingShang> list();

    @Select("delete from gyshang where id=#{id}")
    void deleteById(Integer id);

    @Select("update gyshang set name=#{GongYingShang.name},dizhi=#{GongYingShang.dizhi},phone=#{GongYingShang.phone} where id=#{id}")
    void update(@Param("id") Integer id, @Param("GongYingShang") GongYingShang gongyingshang);

    @Select("select * from gyshang where id=#{id}")
    GongYingShang huixian(Integer id);

    @Select("select * from gyshang")
    List<GongYingShang> list2();
}
